package com.github.pig.nideshop.controller.user;


import com.github.pig.common.util.ZyResult;
import com.github.pig.nideshop.entity.NideshopGoods;
import com.github.pig.nideshop.entity.NideshopUser;
import com.github.pig.nideshop.service.INideshopUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  用户控制器前端控制器
 * </p>
 *
 * @author J神
 * @since 2018-06-11
 */
@RestController
@RequestMapping("/users")
public class NideshopUserController {
    @Autowired
    private INideshopUserService nideshopUserService;

    /**
     * 添加用户
     * @param nideshopUser
     * @return
     */
    @PostMapping
    public ZyResult add(@RequestBody NideshopUser nideshopUser){
        return ZyResult.ok(nideshopUserService.insertOrUpdate(nideshopUser));
    }
    @GetMapping("user")
    public ZyResult userInfo(){
        return ZyResult.ok();
    }
}

